package com.umeox.quranplayer.base;

import androidx.multidex.MultiDexApplication;

import com.tencent.bugly.crashreport.CrashReport;
import com.umeox.moto.common.utils.AndroidUtils;
import com.umeox.quranplayer.BuildConfig;
import com.umeox.quranplayer.R;
import com.umeox.watch.moto.dataservice.DataProvider;
import com.yc.music.utils.MusicSpUtils;

import uk.co.chrisjenx.calligraphy.CalligraphyConfig;


public class BaseApp extends MultiDexApplication {

    private static BaseApp instance;

    public static BaseApp getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        MusicSpUtils.init(this);
        DataProvider.initialize(this);
        //Bugly start
        CrashReport.UserStrategy userStrategy = new CrashReport.UserStrategy(this);
        userStrategy.setAppChannel(BuildConfig.FLAVOR + "-" + AndroidUtils.getDeviceId());
        CrashReport.initCrashReport(this, "a018aa68d5", false, userStrategy);
        //Bugly end
        CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                .setDefaultFontPath("fonts/Roboto-Medium.ttf")
                .setFontAttrId(R.attr.fontPath)
                .build()
        );
    }
}
